<template>
  <el-form-item label="限购规则" prop="payLimitRule" :rules="rules" class="common-form-width">
    <el-radio-group v-model.trim="modelValue">
      <el-radio label="no">无</el-radio>
      <el-radio label="mall_goods">商品规则</el-radio>
      <el-radio label="mall_product">规格规则</el-radio>
      <el-radio label="mall">商城规则</el-radio>
    </el-radio-group>
  </el-form-item>
</template>

<script lang="ts" setup>
const props = withDefaults(defineProps<{
  modelValue: string
}>(), {
  modelValue: ''
})

const emits = defineEmits(['update:model-value'])
const modelValue = computed({
  set(newValue) {
    emits("update:model-value", newValue)
  },
  get() {
    return props.modelValue
  }
})

const rules = [{
  required: true,
  message: '请选择限购规则',
  trigger: 'blur'
}]
</script>

<style scoped lang="scss">
@use "@/components/goodsCenter/styles/common.scss";
</style>
